<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>购物车</title>
		<script type="text/javascript" src="<?php echo $this->getWebViewPath()."javascript/jquery-1.9.1.js";?>"></script>
		
		<link rel="stylesheet" type="text/css" href="<?php echo $this->getWebSkinPath()."products/hui/css/hui.css";?>"/>
		<link rel="stylesheet" type="text/css" href="<?php echo $this->getWebSkinPath()."products/css/cart.css";?>"/>
	</head>
	<body>
		<header class="hui-header header">
		    <div id="hui-back"></div>
		    <span>购物车</span>
		</header>
		
		<div class="hui-wrap">
		
		<?php 
			//print_r($this->seller)
		?>
		
		<?php foreach($this->seller as $seller_id => $item){?>
			<?php $sellerid = $seller_id?>
			<!--每个收藏商品 s-->
			<div class="collection">
				<div class="wrap">
					<!--头部 s-->
					<div class="header">
						<div class="header_content">
							
							<!--头部左边 s-->
							<div class="title">
								<div class="radio store_radio" val="0" >
									 <span style="display: none;" class="hui-icons hui-icons-success"></span>
									 <input class="store_id" type="hidden" value="<?php echo isset($seller_id)?$seller_id:"";?>" />
								</div>
								<div class="image">
									<img src="<?php echo $this->getWebSkinPath()."image/micar.jpg";?>"/>
								</div>	
								<div class="store_name">
									<?php $query = new IQuery("seller");$query->where = "id = $seller_id";$items = $query->find(); foreach($items as $key => $name){?>	
										<a href="<?php echo IUrl::creatUrl("site/home/id/".$seller_id."");?>"><?php echo isset($name['store_name'])?$name['store_name']:"";?>　></a>
									<?php }?>
								</div>
								
							</div>
							<!--头部左边 e-->
							
							<!-- 头部右边 s -->
							<div class="operation">
								<span>编辑</span>
							</div>
							<!-- 头部右边 e -->
							
						</div>
					</div>
					<!--头部 e-->
					
					<!--收藏的内容 s-->
					<?php foreach($this->goodsList as $key => $good){?>
					<?php if($good['seller_id'] == $sellerid){?>
					<div class="collect">
						<div class="collect_content">
							<!--头部左边 s-->
							<div class="s_img">
								<div class="r">
									<div class="radio store_item_radio<?php echo isset($seller_id)?$seller_id:"";?>" val="0" m="0">
										<span  class="hui-icons hui-icons-success"></span>
										<input type="hidden" class="goods_price" value="<?php echo isset($good['sell_price'])?$good['sell_price']:"";?>" />
									</div>
								</div>
								
								<div class="image">
									<img src="<?php echo isset($good['img'])?$good['img']:"";?>"/>
								</div>
							</div>
							<!--头部左边 e-->
							
							<!-- 头部右边 s -->
							<div class="collect_msg">
								<div class="con">
									<div class="desc">
										<div class="title">
											<span>
												<?php echo isset($good['name'])?$good['name']:"";?>
											</span>
										</div>
										<div class="guige">
											<?php if($good['spec_array']){?>
												<?php 
													//echo "<pre>";
													//print_r(json_decode($good['spec_array'],true));
													//echo "</pre>";
													
													$guige = json_decode($good['spec_array'],true);
													
												?>
												<div>
												<?php foreach($guige as $key => $guigeVal){?>
													<?php if($guigeVal['type']==2){?>
														<img style="display: inline-block;" alt="" src="<?php echo isset($guigeVal['value'])?$guigeVal['value']:"";?>">
														<?php }else{?>
														<span style="display: inline-block;"><?php echo isset($guigeVal['value'])?$guigeVal['value']:"";?></span>
													<?php }?>
												<?php }?>
												</div>
											<?php }?>
										</div>
										<div class="limit">
											<span>限购5件</span>
										</div>
										<div class="price">
											<span>¥<?php echo isset($good['sell_price'])?$good['sell_price']:"";?></span>
											<span><del>¥<?php echo isset($good['market_price'])?$good['market_price']:"";?></del></span>
											<span class="num">x<?php echo isset($good['count'])?$good['count']:"";?></span>
										</div>
									</div>
								</div>
							</div>
							<!-- 头部右边 e -->
							
							
							
						</div>
						
					</div>
					<!--收藏的内容 e-->
					<?php }?>
					<?php }?>
					
					
				</div>
				
			</div>
			<!--每个收藏商品 e-->
			<?php }?>
			
		
			
			
			
			<!--底部效果 s-->
			<div class="bottom">
				
				
			</div>
			<!--底部效果 e-->
			
			<!--底部结算条 s-->
			<div class="bottom_flex">
				<div class="content">
					<div class="cartbottom_left">
						<div>
							<div class="radio sum_radio " val="0">
								<span  class="hui-icons hui-icons-success"></span>
							</div>
							<span>全选</span>
						</div>
						
						<div class="settlement">
							<div class="sum_price">
								<span>合计:</span>
								<span class="cart_price">¥0.00</span>
							</div>
							<div class="flag">
								<span>不含运费</span>
							</div>
						</div>
						
					</div>
					<div class="cartbottom_right">
						<a href="#" class="msg">
							<span>结算</span><span>(0)</span>
						</a>
					</div>
					
				</div>
			</div>
			<!--底部结算条 e-->
		</div>
		
		<script src="<?php echo $this->getWebSkinPath()."products/hui/js/hui.js";?>" type="text/javascript" charset="utf-8"></script>
		<script src="<?php echo $this->getWebSkinPath()."products/js/cart.js";?>" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			
			//为所有店铺dadio添加响应
			
			var store = document.getElementsByClassName("store_radio");	
			var good = $(".r .radio");
			
			var cart = new cart_deal();
			
			cart.select(store);
			cart.chilSelect(good);
			cart.listenChil();
			cart.selectAll();
			
			
		</script>
	</body>
</html>
